package com.example.learn.config.listener;


import com.example.learn.entity.User;
import lombok.Data;
import org.springframework.context.ApplicationEvent;

/**
 *
 * 定义事件
 * 还需要定义一个监听器
 *
 */
@Data
public class MyEvent extends ApplicationEvent{

    private static final long serialVersionUID = 1L;

    private User user;

    public MyEvent(Object source, User user) {
        super(source);
        this.user = user;
    }
// 省去 get、set 方法
}
